import React, { Component } from "react";
import { NavLink } from "react-router-dom";
import { connect } from "react-redux";

class Headernew extends Component {
  render() {
    const { login} = this.props;
    return (
      <div className="navbar-wrapper">
        <div className="container">
          <nav className="navbar navbar-inverse navbar-static-top">
            <div className="container">
              <div className="navbar-header">
                <a className="navbar-brand" href="#">
                  亚狗逊
                </a>
              </div>
              <div id="navbar" className="navbar-collapse collapse">
                <ul className="nav navbar-nav">
                  <li className="active">
                  <NavLink to="/" activeClassName="active">首页</NavLink>
                  </li>
                  <li>
                  <NavLink to="/basic-routing" activeClassName="active">新闻模块</NavLink>
                  </li>
                  <li>
                  <NavLink to="/product" activeClassName="active">产品模块</NavLink>
                  </li>
                   <li>
                    <NavLink to="/carts" activeClassName="active">购物车</NavLink>
                  </li>
                 
                </ul>
                <ul className="nav navbar-nav navbar-right">
                 
                  <li>
                    <NavLink to="/blocking" activeClassName="active">{login}</NavLink>
                  </li>
                </ul>
              </div>
            </div>
          </nav>
        </div>
      </div>
    );
  }
}
const getLogin = (state)=>{
  return {
    login:state.block.login,
    
  }
};

const Header = connect(getLogin, {})(Headernew);
export default Header;